package com.yswy.backstage.param;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.groups.Default;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * This is Description
 *
 * @author linlifu
 * @date 2020/01/07
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("user入参")
public class UserPARAM implements Serializable {

    private static final long serialVersionUID = 1L;
    //1 注册 2修改密码
    private Integer type;

    @NotNull(message = "用户ID不能为空", groups = {Update.class, Appoint.class})
    private Integer userId;

    @NotEmpty(message = "角色列表不能为空", groups = Appoint.class)
    private List<Integer> roleIdList;


    @ApiModelProperty("需要删除的角色")
    private List<Integer> toDeleteRoleIdList;

    @NotBlank(message = "姓名不能为空", groups = {Create.class, Update.class,InsideCreate.class})
    private String userName;

    @NotBlank(message = "密码不能为空", groups = {Login.class, Update.class,InsideCreate.class})
    private String pwd;

    private String oldPwd;

    @NotBlank(message = "电话不能为空", groups = {Create.class, Login.class, Update.class , sendMsg.class,InsideCreate.class})
//    @Pattern(regexp = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}$", message = "手机号格式有误")
    private String userPhone;

    @NotNull(message = "充值金额不能为空", groups = {Recharge.class})
    private BigDecimal rechargeMoney;

    @NotNull(message = "赠送金额不能为空", groups = {Recharge.class})
    private BigDecimal sendMoney;

    //备注
    private String remarks;

    @NotNull(message = "pageIndex不能为空", groups = GetList.class)
    private Integer pageIndex;

    @NotNull(message = "pageSize不能为空", groups = GetList.class)
    private Integer pageSize;

    @NotBlank(message = "验证码不能为空", groups = {Create.class,updatepwd.class})
    private String code;

    @NotNull(message = "注册类型不能为空", groups = {Create.class})
    //1 客户   2 咸鱼   3 谷歌
    private Integer sendType;

    @NotNull(message =  "角色类型不能为空",groups = {InsideCreate.class})
    private Integer roleType;
    @NotNull(message =  "角色Id不能为空",groups = {InsideCreate.class})
    private Integer roleId;
    private Integer state;
    private String content;
    @NotNull(message = "邀请码不能为空", groups = {Create.class})
    private String invitationCode;

    public interface Create extends Default {
    }

    public interface InsideCreate extends Default {
    }


    public interface Update extends Default {
    }

    public interface Login extends Default {
    }

    public interface Recharge extends Default {
    }

    public interface Appoint extends Default {
    }

    public interface GetList extends Default {
    }
    public interface sendMsg extends Default {
    }
    public interface updatepwd extends Default {
    }
}
